import { createStore } from 'vuex'

const moduleA = {
  namespaced: true,
  state () {
    return { name: '模块A' }
  },
  getters:{
    newUsername(state:any){
      return state.name +'haha'
    }
  },
  mutations:{
    updateUsername(state:any,newValue:any){
      state.name = newValue

    }
  }
}
const moduleB = {
  namespaced: true,
  state () {
    return { name: '模块B' }
  }
}

export default createStore({
  modules: {
    moduleA,
    moduleB
  }
})